export const manner = {
	goUrl(pages,urls,tab=true){
		if(tab){
			uni.navigateTo({
				url:`/${pages}/${urls}/${urls}`
			})
		}else{
			uni.switchTab({
				url:`/${pages}/${urls}/${urls}`
			})
		}
	},
	goBack(index=0){
		let pages = getCurrentPages();
		if (pages[pages.length - 2]) {
			uni.navigateBack()
		} else {
			if(index===0){
				uni.switchTab({
					url: '/pages/index/index'
				});
			}else{
				uni.switchTab({
					url: '/pages/user/user'
				});
			}
		}
	},
	toLogin(){
		uni.showToast({
			title:'未登录，请先登录',
			icon:'none',
			duration:2000,
			complete() {
				setTimeout(()=>{
					// #ifdef MP-WEIXIN
					uni.navigateTo({
						url: '/pagesMain/wxlogin/wxlogin'
					})
					// #endif
					// #ifdef APP-PLUS
					uni.navigateTo({
						url: '/pagesApp/login/login'
					})
					// #endif
					// #ifdef H5
					let status = navigator.userAgent.toLowerCase();
					//微信浏览器
					if (status.match(/MicroMessenger/i) == "micromessenger") {
						uni.navigateTo({
							url: '/pagesMain/wxlogin/wxAoutlogin'
						})
					}else{
						uni.navigateTo({
							url: '/pagesApp/login/login'
						})
					}
					// #endif
				},2000)
			}
		})
		
	}
}